package com.ali.api;

import com.ali.common.Response;
import com.ali.config.MyOpenFeignFallBackHandler;
import com.ali.dto.PayInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * FeignClient：OpenFeign客户端
 */
@FeignClient(value = "pay-server", fallback = MyOpenFeignFallBackHandler.class)
public interface PayApi {
    /**
     * 查询
     */
    @GetMapping(value = "/pay/query")
    Response<List<PayInfo>> query(@RequestParam Map<String, Object> param);

    /**
     * 超时
     */
    @GetMapping(value = "/pay/timeout")
    Response<String> timeout();

    /**
     * 控制
     */
    @GetMapping(value = "/pay/control")
    Response<String> control(@RequestParam Map<String, Object> param);

    /**
     * 打印
     */
    @GetMapping(value = "/pay/print")
    Response<String> print(@RequestParam Map<String, Object> param, @RequestHeader Map<String, Object> header);

    /**
     * 增加
     */
    @PostMapping(value = "/pay/add")
    Response<String> add(@RequestBody Map<String, Object> param);
}